package com.example.villagemanager.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.villagemanager.R;
import com.example.villagemanager.model.bean.ListViewAdapterBean;

import com.example.villagemanager.ui.base.BaseAdapter;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;

public class ListViewAdapter extends BaseAdapter<ListViewAdapterBean, ListViewAdapter.ViewHolder> {


    public ListViewAdapter(Context mContext, List<ListViewAdapterBean> mList) {
        super(mContext, mList);
    }

    @Override
    protected ViewHolder getViewHolder(View itemView) {
        return new ViewHolder(itemView);
    }

    @Override
    protected int getItemView() {
        return R.layout.liat_view_item;
    }

    @Override
    protected void onBindHolder(ViewHolder holder, int position) {
        ListViewAdapterBean bean=mList.get(position);
        holder.tvNmae.setText(bean.getData1());
        holder.ivIcon.setVisibility(View.GONE);
    }

    static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.item_name)
        TextView tvNmae;
        @BindView(R.id.item_icon)
        ImageView ivIcon;
        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}
